package cbsc.cha4;

import java.io.File;

import cbsc.cha3.ExerciseType;
import cbsc.cha3.Exercise_3_2_3;

public class ExerciseFilesTester {
	ExerciseFiles exercise_file;
	public static void main(String[] args) {
		ExerciseFilesTester tester = new ExerciseFilesTester();
		
		/*
		tester.testWAdd();	
		tester.testWSub();
		tester.testW3();	
		tester.testR2();
		*/
		// 
		tester.testWResult();
		
		
	}
	public void testWResult() {
		exercise_file = new ExerciseFiles();
		Exercise_3_2_3 exercise = new Exercise_3_2_3();
		File file = new File("exercise_mix_50_3");
		System.out.println("reading an exercise file ......");
		exercise = exercise_file.readCSVExercise(file);
		exercise_file.saveExerciseAnswers(exercise, "answers_mix_50_3");
	}
	
	public void testWAdd() {
		exercise_file = new ExerciseFiles();
		exercise_file.saveCSVExercises(5, 70, ExerciseType.ADD_ONLY);
	}
	public void testWSub() {
		exercise_file = new ExerciseFiles();
		exercise_file.saveCSVExercises(7,60,ExerciseType.SUB_ONLY);
	}
	/*
	public void testW3() {
		exercise_file = new ExerciseFiles();
		exercise_file.saveCSVExercises(6, 50,1);
	}
	*/
	public void testR1() {
		exercise_file = new ExerciseFiles();
		
		Exercise_3_2_3 exercise = new Exercise_3_2_3();
		
		File file = new File("exercise_add_50_3.txt");
		System.out.println(file);
		exercise = exercise_file.readCSVExercise(file);
		exercise.formattedDisplay(4);	
	}
	public void testR2() {
		exercise_file = new ExerciseFiles();
		
		Exercise_3_2_3 exercise = new Exercise_3_2_3();
		
		File file = new File("exercise_add_70_2.txt");
		
		exercise = exercise_file.readCSVExercise(file);
		exercise.formattedDisplay(5);
		exercise.formattedDisplayFull(5);
	}

}
